Skip to main content

Random Emails

Generate random emails using DevAssure's code blocks.

Generate random emails using DevAssure

const chars = 'abcdefghijklmnopqrstuvwxyz1234567890';
const domains = ['example.com', 'test.com', 'sample.org'];

const generateRandomString = (length) => {
return Array.from({ length }, () => chars[Math.floor(Math.random() * chars.length)]).join('');
};

const randomString = generateRandomString(10);
const randomDomain = domains[Math.floor(Math.random() * domains.length)];
const data = ${randomString}@${randomDomain};